const initialState = {
	loading:true,
	data: {
		avatar_url: '',
		loginname: '',
		score: '',
		create_at: '',
		recent_topics: [],
		recent_replies: []
	}
}
export default function user(state=initialState,action){
	switch(action.type){
		case 'USER_UPDATE_SUCC':
			return {
				data:action.data,
				loading:false
			}
			case 'USER_UPDATE':
			return {
				data: initialState.data,
				loading:true
			}
		case 'USER_UPDATE_ERROR':
			return {
				data: initialState.data,
				loading:false
			}
		default:
			return state;
	}
}